package com.ssm.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;

public class Book  implements Serializable {
    @Serial
    private static final long serialVersionUID = -2107517819251219160L;
    private Integer id;
    private String bookName;//图书名
    private String author;//作者
    private Double price;//价格
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GNT+8")
    private LocalDate date;//日期
    private String publisher;//出版社
    private String imgUrl;//图片地址

    public Book() {
    }

    public Book(Integer id, String bookName, String author, Double price, LocalDate date, String publisher, String imgUrl) {
        this.id = id;
        this.bookName = bookName;
        this.author = author;
        this.price = price;
        this.date = date;
        this.publisher = publisher;
        this.imgUrl = imgUrl;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    @Override
    public String toString() {
        return "Book{" +
                "id=" + id +
                ", bookName='" + bookName + '\'' +
                ", author='" + author + '\'' +
                ", price=" + price +
                ", date=" + date +
                ", publisher='" + publisher + '\'' +
                ", imgUrl='" + imgUrl + '\'' +
                '}';
    }
}
